import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import API from './api'
import { layer } from 'vue3-layer';
import 'vue3-layer/dist/s3Layer.css';

const app = createApp(App)
// 配置全局 layer
app.config.globalProperties.$layer = layer;
// 配置全局 axios 接口 api
app.config.globalProperties.$api = API;

app.use(router)
app.use(ElementPlus, {locale: zhCn,})

// 注册element-plus所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.mount('#app')

